<include file="../Public/_header.html" />
<div class="so_main">
	<php>if($type!='edit'){</php>
  		<div class="page_tit">录入商户</div>
  <php>}else{</php>
  		<div class="page_tit">修改商户</div>
  <php>}</php>
  <style>
  	.form2 dl{
  		float: left;
    	width: 50%;
    }
  </style>
  <div class="form2">
  	<form method="post" 
  		<php>if($type!='edit'){</php>
  				action="{:U('/Partner/doAddPartner')}" 
		  <php>}else{</php>
		  		action="{:U('/Partner/doEditPartner')}" 
		  <php>}</php>
  				enctype="multipart/form-data">
  	<input name="id" type="hidden" value="{$partner.id}">
  		<div class="clear"></div>
   	<dl class="lineD" style="width:100%;font-weight:bold;">
      <dt>基本信息</dt>
    </dl>
    <dl class="lineD">
      <dt>名称：</dt>
      <dd>
        <input name="title" type="text" value="{$partner.title}">
      </dd>
    </dl>
    
    
    <dl class="lineD">
      <dt>商标：</dt>
      <dd>
      	<input type="file"  name="brand_icon"/>
      </dd>
    </dl>
    
    
    <dl class="lineD">
      <dt>分类：</dt>
      <dd>
      	<input id="sortdesc" type="text" value="{$partner['sort_id']|getCategoryName}" 
      					onclick="ui.box.load(
    											'{:U('Index://Public/showtree',array('code'=>'partner'))}'
    											,{ title:'查看商户分类' })"
      					readonly>
      	<input id="sort_id" name="sort_id" type="hidden" value="{$partner['sort_id']}">
			<script>
					function _tmp_setselectdict(rel,txt){
			    		$('#sortdesc').val(txt);
			    		$('#sort_id').val(rel);
			    }
			</script>
      </dd>
    </dl>
    
    <dl class="lineD">
      <dt>上级：</dt>
      <dd>
        <select id="parent_id" name="parent_id" style="width:153px">
        		{$partner['parent_id']|html_selectPartners}
        </select>
      </dd>
    </dl>
    
    <dl class="lineD">
      <dt>网址：</dt>
      <dd>
        <input name="homepage" type="text" value="{$partner.homepage}">
      </dd>
    </dl>
		
		<div class="clear"></div>
   	<dl class="lineD" style="width:100%;padding-top: 10px;font-weight:bold;">
      <dt>附加信息</dt>
    </dl>
    <dl class="lineD">
      <dt>联系人：</dt>
      <dd>
        <input name="contact" type="text" value="{$partner.contact}">
      </dd>
    </dl>
    
    <dl class="lineD">
      <dt>电话：</dt>
      <dd>
        <input name="phone" type="text" value="{$partner.phone}">
      </dd>
    </dl>
    
    
    <dl class="lineD">
      <dt>手机：</dt>
      <dd>
        <input name="mobile" type="text" value="{$partner.mobile}">
      </dd>
    </dl>
    
    <dl class="lineD">
      <dt>地区：</dt>
      <dd>
        <input type="hidden" id="current" name='gparea' 
					value="{:assembleAreaIds($partner['province_id'],$partner['city_id'],$partner['area_id'])}"/>
				<!--province city area-->
				<input type="text" name="city"  id="selectarea"
					value="{:getAreaDesc($partner['province_id'],$partner['city_id'],$partner['area_id'])}"
					class="text" onfocus="this.className='text2'" onblur="this.className='text'" readonly />
				<input type="button" class="btn_b" value="选择地区" 
					onclick="ui.box.load('{:U('Index://Public/area',array('selected'=>''))}'+$('#current').val(),{title:'选择城市'});" />
      </dd>
    </dl>
    
    <dl class="lineD">
      <dt>地址：</dt>
      <dd>
        <input name="address" type="text" value="{$partner.address}">
      </dd>
    </dl>
    
    <dl class="lineD">
      <dt>邮编：</dt>
      <dd>
        <input name="zipcode" type="text" value="{$partner.zipcode}">
      </dd>
    </dl>
    
    <dl class="lineD">
      <dt>地图：</dt>
      <dd>
        <input name="location" type="text" value="{$partner.location}">
      </dd>
    </dl>
   	<div class="clear"></div>
   	<dl class="lineD" style="width:100%;padding-top: 10px;font-weight:bold;">
      <dt>帐户设置</dt>
    </dl>
    <dl class="lineD" style="width:100%">
      <dt>开户银行：</dt>
      <dd>
        <input name="bank_name" type="text" value="{$partner.bank_name}" style="width:300px">
      </dd>
    </dl>
    <dl class="lineD" style="width:100%">
      <dt>银行账号：</dt>
      <dd>
        <input name="bank_no" type="text" value="{$partner.bank_no}" style="width:300px">
      </dd>
    </dl>
    <dl class="lineD" style="width:100%">
      <dt>开户名：</dt>
      <dd>
        <input name="bank_user" type="text" value="{$partner.bank_user}" style="width:300px">
      </dd>
    </dl>
    <div class="clear"></div>
    <div class="page_btm" style="padding: 18px 0 18px 0;text-align: center;">
      <input type="submit" class="btn_b" value="提交" />
    </div>
    </form>
  </div>

</div>
<include file="../Public/_footer.html" />